# Maintainer: BlackEagle <ike.devolder@gmail.com>>

pkgname=kodi-addon-audioencoder-lame
epoch=1
pkgver=20.3.0
_codename=Nexus
pkgrel=5
pkgdesc="LAME Audio Encoder add-on for Kodi"
arch=('loong64' 'x86_64')
url='https://github.com/xbmc/audioencoder.lame'
license=('GPL')
groups=('kodi-addons' 'kodi-addons-audioencoder')
makedepends=('cmake' 'lame' 'kodi-dev')
options=(!lto)
source=("$pkgname-$pkgver.tar.gz::https://github.com/xbmc/audioencoder.lame/archive/$pkgver-$_codename.tar.gz")
sha512sums=('83956e7874e84f6f1e211352ff031764f8173d554fa22c45eedb96d01275969858378ef52cc8cdb8ab10914e04c5bb460104d511b96f9724c23b4eaa654dd1b9')

build() {
    cd "audioencoder.lame-$pkgver-$_codename"
    cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=1 \
        -DUSE_LTO=1 \
        .
    make
}

package() {
    depends=('kodi' 'lame')
    cd "audioencoder.lame-$pkgver-$_codename"
    make DESTDIR="$pkgdir/" install
}

